<?php
/**
 * Created by PhpStorm.
 * User: 12133
 * Date: 2024/6/4
 * Time: 9:47
 */

namespace app\model\index;


class UserSearchKeyword extends Base
{
    protected $autoWriteTimestamp = 'datetime';
    protected $append = [
        'area_type'
    ];

    public function getAreaTypeAttr($value){
        if ($value == 'baidu')
            return '百度';
        else
            return '抖音';
    }

    public function getKeywordsPriceAttr(){

    }

    public function keywords(){
        return $this->hasOne(Keyword::class,'keyword','keyword')->field('keyword,price,zz_all,baiduyingxiao_click');
    }
}